home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / gcc / gcc261c.zoo / objects / Bag.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-18  |  1.9 KB  |  64 lines

  1. /* Interface for Objective-C Bag collection object
  2.    Copyright (C) 1993,1994 Free Software Foundation, Inc.
  3.  
  4.    Written by:  R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
  5.    Date: May 1993
  6.  
  7.    This file is part of the GNU Objective C Class Library.
  8.  
  9.    This library is free software; you can redistribute it and/or
  10.    modify it under the terms of the GNU Library General Public
  11.    License as published by the Free Software Foundation; either
  12.    version 2 of the License, or (at your option) any later version.
  13.    
  14.    This library is distributed in the hope that it will be useful,
  15.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17.    Library General Public License for more details.
  18.  
  19.    You should have received a copy of the GNU Library General Public
  20.    License along with this library; if not, write to the Free
  21.    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. */ 
  23.  
  24. #ifndef __Bag_h_INCLUDE_GNU
  25. #define __Bag_h_INCLUDE_GNU
  26.  
  27. #include <objects/stdobjects.h>
  28. #include <objects/Set.h>
  29.  
  30. @interface Bag : Set
  31. {
  32.   unsigned int _count;        // the number of elements;
  33. }
  34.  
  35. // ADDING;
  36. - addObject: newObject withOccurrences: (unsigned)count;
  37.  
  38. // REMOVING AND REPLACING;
  39. - removeObject: oldObject occurrences: (unsigned)count;
  40. - removeObject: oldObject occurrences: (unsigned)count
  41.     ifAbsentCall: (id(*)(arglist_t))excFunc;
  42.  
  43. // TESTING;
  44. - (unsigned) uniqueCount;
  45.  
  46.  
  47. // NON-OBJECT ELEMENT METHOD NAMES;
  48.  
  49. // INITIALIZING AND FREEING;
  50. - initWithType: (const char *)contentEncoding
  51.     capacity: (unsigned)aCapacity;
  52.  
  53. // ADDING;
  54. - addElement: (elt)newElement withOccurrences: (unsigned)count;
  55.  
  56. // REMOVING AND REPLACING;
  57. - (elt) removeElement:(elt)oldElement occurrences: (unsigned)count;
  58. - (elt) removeElement:(elt)oldElement occurrences: (unsigned)count
  59.     ifAbsentCall: (elt(*)(arglist_t))excFunc;
  60.  
  61. @end
  62.  
  63. #endif /* __Bag_h_INCLUDE_GNU */
  64.